﻿using System;
using System.Data;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.SqlClient;

namespace ASPNETVN.PORTAL.Modules.FAQ.Components
{
    public partial class Item
    {
        public int Approve()
        {
            string spName = "[dbo].[p_FAQ_Item_Approve]";
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand(spName);
            db.AddInParameter(dbCommand, "@ID", DbType.Int32, ID);
            db.AddInParameter(dbCommand, "@ApprovedBy", DbType.String, ApprovedBy);
            db.AddInParameter(dbCommand, "@ApprovedDate", DbType.DateTime, ApprovedDate);
            db.AddInParameter(dbCommand, "@PublishedDate", DbType.DateTime, PublishedDate);
            db.AddInParameter(dbCommand, "@ExpiredDate", DbType.DateTime, ExpiredDate);
            return db.ExecuteNonQuery(dbCommand);
        }
    }
}
